package com.right.handler;

import com.right.command.CsCommand;
import com.right.factory.NodeStatus;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * Created by ding on 2019/1/17.
 */
@Slf4j
public class UnLockHandler implements PackageHandler {
    @Override
    public boolean applies(List<String> dataList) {
        return CsCommand.UN_LOCK.equals(dataList.get(0));
    }

    @Override
    public boolean handleMessage(ChannelHandlerContext ctx, List<String> dataList) {
       String lockNo =  ctx.channel().attr(NodeStatus.LOCK_NO).get();
        log.info("锁打开={}",lockNo);
        return false;
    }
}
